import React,{Component} from "react";
import Son2 from "./Son2"
class Father2 extends Component{
    state={
        price:10
    }
    updatePrice=(price)=>{
        this.setState({
            price
        })
    }
    render(){
        return(<>
        <p>父组件</p>
        当前水果价格为：{this.state.price}
        <Son2 updatePrice={this.updatePrice} price={this.state.price}></Son2>
        </>
        )
    }
}

export default Father2